﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace InfiniteRogue
{
    public class Log
    {
        private static Log _instance;
        public static Log Instance
        {
            get { return _instance ?? (_instance = new Log()); }
        }

        private Log()
        {

        }

        public enum LogLevel
        {
            System, LowImportance, MediumImportance, HighImportance
        }

        public void GameLog(string message, LogLevel importance)
        {
#if DEBUG
            Console.WriteLine(message);
#endif
            if (NewLogEntry != null)
            {
                NewLogEntry(message, importance);
            }
        }

        public void SystemLog(string message)
        {
            Console.WriteLine(message);
            if (NewLogEntry != null)
            {
                NewLogEntry(message, LogLevel.System);
            }
        }

        public delegate void LogEventHandler(string message, LogLevel importance);
        public event LogEventHandler NewLogEntry;
    }
}
